StepResult

data class StepResult(val stepNumber: Int, val text: String, val reasoning: String, val toolCalls: List<ContentPart.ToolCall>, val toolResults: List<ContentPart.ToolResult>, val toolApprovalRequests: List<ContentPart.ToolApprovalRequest>, val finishReason: FinishReason, val usage: Usage, val warnings: List<CallWarning> = emptyList(), val request: LanguageModelRequestMetadata = LanguageModelRequestMetadata(), val response: LanguageModelResponseMetadata = LanguageModelResponseMetadata(), val providerMetadata: Map<String, JsonElement> = emptyMap(), val rawFinishReason: String? = null, val model: String? = null, val experimentalContext: Any? = null)

Snapshot of one completed loop step — surfaced to OnStepFinishEvent and accumulated in the loop state for PrepareStepScope.steps.

Constructors

Link copied to clipboard
constructor(stepNumber: Int, text: String, reasoning: String, toolCalls: List<ContentPart.ToolCall>, toolResults: List<ContentPart.ToolResult>, toolApprovalRequests: List<ContentPart.ToolApprovalRequest>, finishReason: FinishReason, usage: Usage, warnings: List<CallWarning> = emptyList(), request: LanguageModelRequestMetadata = LanguageModelRequestMetadata(), response: LanguageModelResponseMetadata = LanguageModelResponseMetadata(), providerMetadata: Map<String, JsonElement> = emptyMap(), rawFinishReason: String? = null, model: String? = null, experimentalContext: Any? = null)

Properties

Link copied to clipboard

The evolving agent context live for this step (upstream's experimental_context).

Link copied to clipboard
Link copied to clipboard

The model id that produced this step (upstream's model.modelId).

Link copied to clipboard
val providerMetadata: Map<String, JsonElement>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The non-empty reasoning text for this step, or null — mirrors upstream's reasoningText.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Tool calls/results split by static (tool(...)) vs dynamic (dynamicTool(...)), per upstream.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard